package com.sunrise.xdoc.entity.user;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import com.sunrise.xdoc.entity.AbstractAuditEntity;
import com.sunrise.xdoc.entity.config.InternalCode;
import com.sunrise.xdoc.entity.config.UploadFile;

/**
 * All public information about user in institution
 * 
 */
@Entity
@Table(name = "op_user_profile")
@Inheritance(strategy = InheritanceType.JOINED)
public class EmployeeProfile extends AbstractAuditEntity {
	private static final long serialVersionUID = 1L;
	private String firstName;
	private String middleNam;
	private String lastName;
	private String fullName;

	private UploadFile photo;

	public enum Sex {
		MAN, WOMAN, UNDEFINED
	}

	private Sex sex = Sex.UNDEFINED;
	private String secondName; // Ten goi khac
	private String birthPlace; // Noi sinh
	private String originHomeTown; // Nguyen quan
	private Boolean isStaying; // Co cu tru?
	private InternalCode folk; // Dan toc
	private InternalCode religion; // Ton giao

	public enum MarriageStatus {
		SINGLE, MARRIAGE, DIVORCE
	}

	private MarriageStatus marrigeStatus = MarriageStatus.SINGLE;
	private Date startProbation; // ngay thu viec
	private Date startWorking; // ngay lam viec chinh thuc
	private String taxNumber; // Ma so thue
	private Date firstTaxDate; // Ngay cap ma so thue
	private String taxJoinPlace; // Noi cap ma so thue

	private String saNumber; // So bao hiem xa hoi
	private Date firstJoinSA; // Ngay tham gia BHXH
	private Date startSAInCompany; // Ngay tham gia BHXH o cong ty

	private String bankAccount; // so tai khoan ngan hang
	private String bankPlace; // chi nhanh ngan hang
	private InternalCode bankCity; // Thuoc tinh (TP)

	private InternalCode workingMethod; // full-time, part-time
	private Integer companyDistance; // Khoang cach den cong ty (m)
	private Boolean isRentRoom; // Phai thue nha

	private String cmndNumber; // So CMND
	private Date cmndStartDate; // Ngay cap CMND
	private String cmndPlace; // Noi cap CMND
	private String passportNumber; // So ho chieu
	private Date passportStartDate; // Ngay cap ho chieu
	private String passportPlace; // Noi cap ho chieu
	private Date passportEndDate; // Ngay het han ho chieu

	private String address; // ho khau thuong tru
	private String currentAddress; // cho o hien tai
	private String fixPhone; // dien thoai ban
	private String phone; // dien thoai di dong
	private String email;
	private String nick; // nick yahoo, skype, gtalk

	// Trinh do hoc van - TIEU_HOC, THCS, THPT, TRUNG_CAP, CAO_DANG, DAI_HOC,
	// SAU_DH
	private InternalCode educationStatus;

	// Bang cap - cu nhan, ky su, tien si, thac si, trung cap
	private InternalCode certification;

	// Hinh thuc dao tao - chinh quy, tai chuc, mo rong, trau doi bo sung, khac
	private InternalCode certMethod;

	private Integer startCertYear; // nam bat dau

	private Integer graduateCertYear; // nam tot nghiep

	private InternalCode certLevel; // Loai tot nghiep
	private InternalCode universtity; // Noi toi nghiep
	private InternalCode certSubject; // Chuyen nganh dao tao
	private InternalCode computerLevel; // Trinh do tin hoc
	private InternalCode politicLevel; // Trinh do chinh tri
	private InternalCode ecoManagementLevel; // Trinh do quan ly kinh te
	private InternalCode nationManagementLevel; // Trinh do quan ly nha nuoc
	private InternalCode hocHam;
	private Date hocHamDate;
	private InternalCode hocVi;
	private Date hocViDate;
	// 1999-2000: Engineer at Cty A; 2000-2005: Project leader at Cty B.
	private String lichSuLamViec;

	private Date doanDate; // Ngay vao Doan
	private String doanPlace; // Noi vao Doan
	private Date congDoanDate; // Ngay vao Cong Doan

	private String chucVuCongDoan;
	private Date dangDate1; // Ngay vao Dang
	private Date dangDate2; // Ngay chinh thuc
	private String dangPlace; // Noi vao Dang
	private Date nhapNguDate; // Ngay nhap ngu
	private Date xuatNguDate; // Ngay xuat ngu
	private InternalCode capBacQuanDoi; // Cap bac trong quan doi
	private InternalCode chucVuQuanDoi; // Chuc vu trong quan doi

	private InternalCode sucKhoe;
	private InternalCode nhomMau;
	private Integer height; // cm
	private Integer weight; // kg
	private InternalCode doiTuongChinhSach;
	private InternalCode thanhPhanGiaDinh;
	private InternalCode danhHieuDuocPhong;
	private String visitedCoutries; // Cac nuoc da den

	private Boolean hasSoYeuLyLich;
	private Boolean hasGiayKhamSucKhoe;
	private Boolean hasCMND;
	private Boolean hasSoHoKhau;
	private Boolean hasPhoto;
	private Boolean hasBangTotNghiep;
	private Boolean hasSoBHXH;
	private Boolean hasBanTotNghiepGoc;

	@Column(name = "firstName", length = 50)
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	@Column(name = "middleNam", length = 128)
	public String getMiddleNam() {
		return middleNam;
	}

	public void setMiddleNam(String middleNam) {
		this.middleNam = middleNam;
	}

	@Column(name = "lastName", length = 50)
	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	@Column(name = "fullName", length = 256)
	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@ManyToOne
	@JoinColumn(name = "photo_id")
	public UploadFile getPhoto() {
		return photo;
	}

	public void setPhoto(UploadFile photo) {
		this.photo = photo;
	}

	@Column(name = "sex", nullable = false)
	@NotNull
	@Enumerated(EnumType.STRING)
	public Sex getSex() {
		return sex;
	}

	public void setSex(Sex sex) {
		this.sex = sex;
	}

	@Column(name = "secondName", length = 128)
	public String getSecondName() {
		return secondName;
	}

	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	@Column(name = "getBirthPlace", length = 256)
	public String getBirthPlace() {
		return birthPlace;
	}

	public void setBirthPlace(String birthPlace) {
		this.birthPlace = birthPlace;
	}

	@Column(name = "originHomeTown", length = 256)
	public String getOriginHomeTown() {
		return originHomeTown;
	}

	public void setOriginHomeTown(String originHomeTown) {
		this.originHomeTown = originHomeTown;
	}

	@Column(name = "isStaying")
	public Boolean getIsStaying() {
		return isStaying;
	}

	public void setIsStaying(Boolean isStaying) {
		this.isStaying = isStaying;
	}

	@ManyToOne
	@JoinColumn(name = "folk")
	public InternalCode getFolk() {
		return folk;
	}

	public void setFolk(InternalCode folk) {
		this.folk = folk;
	}

	@ManyToOne
	@JoinColumn(name = "religion")
	public InternalCode getReligion() {
		return religion;
	}

	public void setReligion(InternalCode religion) {
		this.religion = religion;
	}

	@Column(name = "marrigeStatus")
	@Enumerated(EnumType.STRING)
	public MarriageStatus getMarrigeStatus() {
		return marrigeStatus;
	}

	public void setMarrigeStatus(MarriageStatus marrigeStatus) {
		this.marrigeStatus = marrigeStatus;
	}

	@Column(name = "startProbation")
	public Date getStartProbation() {
		return startProbation;
	}

	public void setStartProbation(Date startProbation) {
		this.startProbation = startProbation;
	}

	@Column(name = "startWorking")
	public Date getStartWorking() {
		return startWorking;
	}

	public void setStartWorking(Date startWorking) {
		this.startWorking = startWorking;
	}

	@Column(name = "taxNumber", length = 20)
	public String getTaxNumber() {
		return taxNumber;
	}

	public void setTaxNumber(String taxNumber) {
		this.taxNumber = taxNumber;
	}

	@Column(name = "firstTaxDate")
	public Date getFirstTaxDate() {
		return firstTaxDate;
	}

	public void setFirstTaxDate(Date firstTaxDate) {
		this.firstTaxDate = firstTaxDate;
	}

	@Column(name = "taxJoinPlace", length = 256)
	public String getTaxJoinPlace() {
		return taxJoinPlace;
	}

	public void setTaxJoinPlace(String taxJoinPlace) {
		this.taxJoinPlace = taxJoinPlace;
	}

	@Column(name = "saNumber", length = 20)
	public String getSaNumber() {
		return saNumber;
	}

	public void setSaNumber(String saNumber) {
		this.saNumber = saNumber;
	}

	@Column(name = "firstJoinSA")
	public Date getFirstJoinSA() {
		return firstJoinSA;
	}

	public void setFirstJoinSA(Date firstJoinSA) {
		this.firstJoinSA = firstJoinSA;
	}

	@Column(name = "startSAInCompany")
	public Date getStartSAInCompany() {
		return startSAInCompany;
	}

	public void setStartSAInCompany(Date startSAInCompany) {
		this.startSAInCompany = startSAInCompany;
	}

	@Column(name = "bankAccount", length = 32)
	public String getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(String bankAccount) {
		this.bankAccount = bankAccount;
	}

	@Column(name = "bankPlace", length = 256)
	public String getBankPlace() {
		return bankPlace;
	}

	public void setBankPlace(String bankPlace) {
		this.bankPlace = bankPlace;
	}

	@ManyToOne
	@JoinColumn(name = "bankCity")
	public InternalCode getBankCity() {
		return bankCity;
	}

	public void setBankCity(InternalCode bankCity) {
		this.bankCity = bankCity;
	}

	@ManyToOne
	@JoinColumn(name = "workingMethod")
	public InternalCode getWorkingMethod() {
		return workingMethod;
	}

	public void setWorkingMethod(InternalCode workingMethod) {
		this.workingMethod = workingMethod;
	}

	@Column(name = "companyDistance")
	public Integer getCompanyDistance() {
		return companyDistance;
	}

	public void setCompanyDistance(Integer companyDistance) {
		this.companyDistance = companyDistance;
	}

	@Column(name = "isRentRoom")
	public Boolean getIsRentRoom() {
		return isRentRoom;
	}

	public void setIsRentRoom(Boolean isRentRoom) {
		this.isRentRoom = isRentRoom;
	}

	@Column(name = "cmndNumber", length = 20)
	public String getCmndNumber() {
		return cmndNumber;
	}

	public void setCmndNumber(String cmndNumber) {
		this.cmndNumber = cmndNumber;
	}

	@Column(name = "cmndStartDate")
	public Date getCmndStartDate() {
		return cmndStartDate;
	}

	public void setCmndStartDate(Date cmndStartDate) {
		this.cmndStartDate = cmndStartDate;
	}

	@Column(name = "cmndPlace", length = 256)
	public String getCmndPlace() {
		return cmndPlace;
	}

	public void setCmndPlace(String cmndPlace) {
		this.cmndPlace = cmndPlace;
	}

	@Column(name = "passportNumber", length = 32)
	public String getPassportNumber() {
		return passportNumber;
	}

	public void setPassportNumber(String passportNumber) {
		this.passportNumber = passportNumber;
	}

	@Column(name = "passportStartDate")
	public Date getPassportStartDate() {
		return passportStartDate;
	}

	public void setPassportStartDate(Date passportStartDate) {
		this.passportStartDate = passportStartDate;
	}

	@Column(name = "passportPlace", length = 256)
	public String getPassportPlace() {
		return passportPlace;
	}

	public void setPassportPlace(String passportPlace) {
		this.passportPlace = passportPlace;
	}

	@Column(name = "passportEndDate")
	public Date getPassportEndDate() {
		return passportEndDate;
	}

	public void setPassportEndDate(Date passportEndDate) {
		this.passportEndDate = passportEndDate;
	}

	@Column(name = "address", length = 256)
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "currentAddress", length = 256)
	public String getCurrentAddress() {
		return currentAddress;
	}

	public void setCurrentAddress(String currentAddress) {
		this.currentAddress = currentAddress;
	}

	@Column(name = "fixPhone", length = 16)
	public String getFixPhone() {
		return fixPhone;
	}

	public void setFixPhone(String fixPhone) {
		this.fixPhone = fixPhone;
	}

	@Column(name = "phone", length = 16)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "email", length = 32)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "nick", length = 32)
	public String getNick() {
		return nick;
	}

	public void setNick(String nick) {
		this.nick = nick;
	}

	@ManyToOne
	@JoinColumn(name = "educationStatus")
	public InternalCode getEducationStatus() {
		return educationStatus;
	}

	public void setEducationStatus(InternalCode educationStatus) {
		this.educationStatus = educationStatus;
	}

	@ManyToOne
	@JoinColumn(name = "certification")
	public InternalCode getCertification() {
		return certification;
	}

	public void setCertification(InternalCode certification) {
		this.certification = certification;
	}

	@ManyToOne
	@JoinColumn(name = "certMethod")
	public InternalCode getCertMethod() {
		return certMethod;
	}

	public void setCertMethod(InternalCode certMethod) {
		this.certMethod = certMethod;
	}

	@Column(name = "startCertYear")
	public Integer getStartCertYear() {
		return startCertYear;
	}

	public void setStartCertYear(Integer startCertYear) {
		this.startCertYear = startCertYear;
	}

	@Column(name = "graduateCertYear")
	public Integer getGraduateCertYear() {
		return graduateCertYear;
	}

	public void setGraduateCertYear(Integer graduateCertYear) {
		this.graduateCertYear = graduateCertYear;
	}

	@ManyToOne
	@JoinColumn(name = "certLevel")
	public InternalCode getCertLevel() {
		return certLevel;
	}

	public void setCertLevel(InternalCode certLevel) {
		this.certLevel = certLevel;
	}

	@ManyToOne
	@JoinColumn(name = "universtity")
	public InternalCode getUniverstity() {
		return universtity;
	}

	public void setUniverstity(InternalCode universtity) {
		this.universtity = universtity;
	}

	@ManyToOne
	@JoinColumn(name = "certSubject")
	public InternalCode getCertSubject() {
		return certSubject;
	}

	public void setCertSubject(InternalCode certSubject) {
		this.certSubject = certSubject;
	}

	@ManyToOne
	@JoinColumn(name = "computerLevel")
	public InternalCode getComputerLevel() {
		return computerLevel;
	}

	public void setComputerLevel(InternalCode computerLevel) {
		this.computerLevel = computerLevel;
	}

	@ManyToOne
	@JoinColumn(name = "politicLevel")
	public InternalCode getPoliticLevel() {
		return politicLevel;
	}

	public void setPoliticLevel(InternalCode politicLevel) {
		this.politicLevel = politicLevel;
	}

	@ManyToOne
	@JoinColumn(name = "ecoManagementLevel")
	public InternalCode getEcoManagementLevel() {
		return ecoManagementLevel;
	}

	public void setEcoManagementLevel(InternalCode ecoManagementLevel) {
		this.ecoManagementLevel = ecoManagementLevel;
	}

	@ManyToOne
	@JoinColumn(name = "nationManagementLevel")
	public InternalCode getNationManagementLevel() {
		return nationManagementLevel;
	}

	public void setNationManagementLevel(InternalCode nationManagementLevel) {
		this.nationManagementLevel = nationManagementLevel;
	}

	@ManyToOne
	@JoinColumn(name = "hocHam")
	public InternalCode getHocHam() {
		return hocHam;
	}

	public void setHocHam(InternalCode hocHam) {
		this.hocHam = hocHam;
	}

	@Column(name = "hocHamDate")
	public Date getHocHamDate() {
		return hocHamDate;
	}

	public void setHocHamDate(Date hocHamDate) {
		this.hocHamDate = hocHamDate;
	}

	@ManyToOne
	@JoinColumn(name = "hocVi")
	public InternalCode getHocVi() {
		return hocVi;
	}

	public void setHocVi(InternalCode hocVi) {
		this.hocVi = hocVi;
	}

	@Column(name = "hocViDate")
	public Date getHocViDate() {
		return hocViDate;
	}

	public void setHocViDate(Date hocViDate) {
		this.hocViDate = hocViDate;
	}

	// rich text box
	@Column(name = "lichSuLamViec", length = 1024)
	public String getLichSuLamViec() {
		return lichSuLamViec;
	}

	public void setLichSuLamViec(String lichSuLamViec) {
		this.lichSuLamViec = lichSuLamViec;
	}

	@Column(name = "doanDate")
	public Date getDoanDate() {
		return doanDate;
	}

	public void setDoanDate(Date doanDate) {
		this.doanDate = doanDate;
	}

	@Column(name = "doanPlace", length = 256)
	public String getDoanPlace() {
		return doanPlace;
	}

	public void setDoanPlace(String doanPlace) {
		this.doanPlace = doanPlace;
	}

	@Column(name = "congDoanDate")
	public Date getCongDoanDate() {
		return congDoanDate;
	}

	public void setCongDoanDate(Date congDoanDate) {
		this.congDoanDate = congDoanDate;
	}

	@Column(name = "chucVuCongDoan", length = 128)
	public String getChucVuCongDoan() {
		return chucVuCongDoan;
	}

	public void setChucVuCongDoan(String chucVuCongDoan) {
		this.chucVuCongDoan = chucVuCongDoan;
	}

	@Column(name = "dangDate1")
	public Date getDangDate1() {
		return dangDate1;
	}

	public void setDangDate1(Date dangDate1) {
		this.dangDate1 = dangDate1;
	}

	@Column(name = "dangDate2")
	public Date getDangDate2() {
		return dangDate2;
	}

	public void setDangDate2(Date dangDate2) {
		this.dangDate2 = dangDate2;
	}

	@Column(name = "dangPlace", length = 256)
	public String getDangPlace() {
		return dangPlace;
	}

	public void setDangPlace(String dangPlace) {
		this.dangPlace = dangPlace;
	}

	@Column(name = "nhapNguDate")
	public Date getNhapNguDate() {
		return nhapNguDate;
	}

	public void setNhapNguDate(Date nhapNguDate) {
		this.nhapNguDate = nhapNguDate;
	}

	@Column(name = "xuatNguDate")
	public Date getXuatNguDate() {
		return xuatNguDate;
	}

	public void setXuatNguDate(Date xuatNguDate) {
		this.xuatNguDate = xuatNguDate;
	}

	@ManyToOne
	@JoinColumn(name = "capBacQuanDoi")
	public InternalCode getCapBacQuanDoi() {
		return capBacQuanDoi;
	}

	public void setCapBacQuanDoi(InternalCode capBacQuanDoi) {
		this.capBacQuanDoi = capBacQuanDoi;
	}

	@ManyToOne
	@JoinColumn(name = "chucVuQuanDoi")
	public InternalCode getChucVuQuanDoi() {
		return chucVuQuanDoi;
	}

	public void setChucVuQuanDoi(InternalCode chucVuQuanDoi) {
		this.chucVuQuanDoi = chucVuQuanDoi;
	}

	@ManyToOne
	@JoinColumn(name = "sucKhoe")
	public InternalCode getSucKhoe() {
		return sucKhoe;
	}

	public void setSucKhoe(InternalCode sucKhoe) {
		this.sucKhoe = sucKhoe;
	}

	@ManyToOne
	@JoinColumn(name = "nhomMau")
	public InternalCode getNhomMau() {
		return nhomMau;
	}

	public void setNhomMau(InternalCode nhomMau) {
		this.nhomMau = nhomMau;
	}

	@Column(name = "height")
	public Integer getHeight() {
		return height;
	}

	public void setHeight(Integer height) {
		this.height = height;
	}

	@Column(name = "weight")
	public Integer getWeight() {
		return weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	@ManyToOne
	@JoinColumn(name = "doiTuongChinhSach")
	public InternalCode getDoiTuongChinhSach() {
		return doiTuongChinhSach;
	}

	public void setDoiTuongChinhSach(InternalCode doiTuongChinhSach) {
		this.doiTuongChinhSach = doiTuongChinhSach;
	}

	@ManyToOne
	@JoinColumn(name = "thanhPhanGiaDinh")
	public InternalCode getThanhPhanGiaDinh() {
		return thanhPhanGiaDinh;
	}

	public void setThanhPhanGiaDinh(InternalCode thanhPhanGiaDinh) {
		this.thanhPhanGiaDinh = thanhPhanGiaDinh;
	}

	@ManyToOne
	@JoinColumn(name = "danhHieuDuocPhong")
	public InternalCode getDanhHieuDuocPhong() {
		return danhHieuDuocPhong;
	}

	public void setDanhHieuDuocPhong(InternalCode danhHieuDuocPhong) {
		this.danhHieuDuocPhong = danhHieuDuocPhong;
	}

	@Column(name = "visitedCoutries", length = 128)
	public String getVisitedCoutries() {
		return visitedCoutries;
	}

	public void setVisitedCoutries(String visitedCoutries) {
		this.visitedCoutries = visitedCoutries;
	}

	@Column(name = "hasSoYeuLyLich")
	public Boolean getHasSoYeuLyLich() {
		return hasSoYeuLyLich;
	}

	public void setHasSoYeuLyLich(Boolean hasSoYeuLyLich) {
		this.hasSoYeuLyLich = hasSoYeuLyLich;
	}

	@Column(name = "hasGiayKhamSucKhoe")
	public Boolean getHasGiayKhamSucKhoe() {
		return hasGiayKhamSucKhoe;
	}

	public void setHasGiayKhamSucKhoe(Boolean hasGiayKhamSucKhoe) {
		this.hasGiayKhamSucKhoe = hasGiayKhamSucKhoe;
	}

	@Column(name = "hasCMND")
	public Boolean getHasCMND() {
		return hasCMND;
	}

	public void setHasCMND(Boolean hasCMND) {
		this.hasCMND = hasCMND;
	}

	@Column(name = "hasSoHoKhau")
	public Boolean getHasSoHoKhau() {
		return hasSoHoKhau;
	}

	public void setHasSoHoKhau(Boolean hasSoHoKhau) {
		this.hasSoHoKhau = hasSoHoKhau;
	}

	@Column(name = "hasPhoto")
	public Boolean getHasPhoto() {
		return hasPhoto;
	}

	public void setHasPhoto(Boolean hasPhoto) {
		this.hasPhoto = hasPhoto;
	}

	@Column(name = "hasBangTotNghiep")
	public Boolean getHasBangTotNghiep() {
		return hasBangTotNghiep;
	}

	public void setHasBangTotNghiep(Boolean hasBangTotNghiep) {
		this.hasBangTotNghiep = hasBangTotNghiep;
	}

	@Column(name = "hasSoBHXH")
	public Boolean getHasSoBHXH() {
		return hasSoBHXH;
	}

	public void setHasSoBHXH(Boolean hasSoBHXH) {
		this.hasSoBHXH = hasSoBHXH;
	}

	@Column(name = "hasBanTotNghiepGoc")
	public Boolean getHasBanTotNghiepGoc() {
		return hasBanTotNghiepGoc;
	}

	public void setHasBanTotNghiepGoc(Boolean hasBanTotNghiepGoc) {
		this.hasBanTotNghiepGoc = hasBanTotNghiepGoc;
	}

	// TODO Bang: Vi tri hien tai & Noi lam viec
}
